@extends('layouts.console_header')

@section('title', '反馈详情')

@section('resources')
    @parent
    <!-- css 文件 -->

@endsection

@section('content')
<!--  html内容  -->
<section class="user_list">
	<div style="border-bottom: 2px solid #9955c6;overflow: hidden;">
		<p class="fz_14 account_title fl" style="border: none;">
		    <span style="color: #7f7f7f;">首页>用户版运营>
		        <a href="/console/user/feedback/management?cityid={{$cityid}}">反馈管理></a>
		    </span>
		    <span class="co_violet">详情</span>
        </p>
		<a onclick="history.go(-1);" href="#"><p class="fr tc back_btn">返回</p></a>
	</div>
	<form action="" method="">
		<ul class="feedback_manage">
		    <li>
                <p>用户昵称</p>
                <p>{{$username}}</p>
            </li>
            <li>
                <p>用户帐号</p>
                <p>{{$mobile}}</p>
            </li>
			<li>
				<p>反馈内容</p>
				<p>{{$content}}</p>
			</li>
			<li>
				<span>处理状态</span>
            @if($status == '1')
                <input type="radio" name="status" value="0">未处理
                <input type="radio" name="status" value="1" checked>已处理
            @else
				<input type="radio" name="status" value="0" checked>未处理
				<input type="radio" name="status" value="1">已处理
            @endif
			</li>
			<li>
				<span style="margin-right: 20px;">操作人</span>
				<span>{{$adminname}} - {{$adminmobile}}</span>
			</li>
			<li>
				<p>处理备注</p>
				<textarea name="note" id="" cols="30" rows="10">{{$note}}</textarea>
			</li>
		</ul>
		<div style="width: 1160px;margin: 20px 10px;" class="oh">
            <input class="sure fl" type="button" id="submit_data" style="background-color: #9955c6;" value="保存"/>
            <input class="cancel fr" type="button" value="取消" onclick="history.go(-1);"/>
        </div>
	</form>
</section>
@endsection

@section('scriptResources')
    @parent
    <script>
        var cityid='{{$cityid}}';
        var feedbackid = '{{$feedbackid}}';
        $("#submit_data").click(function() {
            var status = $("input[name='status']:checked").val();
            if(status != '1') {
                alert("请选择已处理");return;
            }
            var note = $("textarea[name='note']").val();
            $.ajax({
                url : '/console/user/feedback/edit',
                data:{
                    cityid:cityid,
                    feedbackid:feedbackid,
                    status:status,
                    note:note
                    },
                dataType:'json',
                type:'post',
                success:function(data){
                    if(data.status == 'success') {
                        alert(data.message);
                        window.location.href="/console/user/feedback/management?cityid="+cityid;
                    } else {
                        alert(data.message);
                    }
                }
            });
        })

    </script>
@endsection